using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class WaybillInfoMap : EntityTypeConfiguration<WaybillInfo>
	{
		public WaybillInfoMap()
		{
			// Primary Key
			this.HasKey(t => t.WaybillNO);

			// Properties
			this.Property(t => t.WayBillInfoCodes)
				.HasMaxLength(200);
				
			this.Property(t => t.WayBillInfoNames)
				.HasMaxLength(200);
				
			this.Property(t => t.WayBillBoxNo)
				.HasMaxLength(30);
				
			this.Property(t => t.WaybillBoxModel)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("WaybillInfo");
			this.Property(t => t.WaybillNO).HasColumnName("WaybillNO");
			this.Property(t => t.WayBillInfoCodes).HasColumnName("WayBillInfoCodes");
			this.Property(t => t.WayBillInfoNames).HasColumnName("WayBillInfoNames");
			this.Property(t => t.WayBillInfoNums).HasColumnName("WayBillInfoNums");
			this.Property(t => t.WayBillInfoWeight).HasColumnName("WayBillInfoWeight");
			this.Property(t => t.WayBillInfoVolume).HasColumnName("WayBillInfoVolume");
			this.Property(t => t.WayBillBoxNo).HasColumnName("WayBillBoxNo");
			this.Property(t => t.WaybillBoxModel).HasColumnName("WaybillBoxModel");
			this.Property(t => t.IsDeleted).HasColumnName("IsDeleted");
		}
	}
}

